package com.workflow.itrun.controller;

import com.github.pagehelper.PageInfo;
import com.workflow.itrun.entity.Seckill;
import com.workflow.itrun.service.SeckillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Controller
public class SeckillController {



    @Autowired
    private SeckillService seckillService;

    @RequestMapping(value = "/get-list",method = RequestMethod.GET)
    @ResponseBody
    public PageInfo<Seckill> selectList(Integer pageIndex,Integer pageSize){
        PageInfo<Seckill> seckillPageInfo = seckillService.selectList(pageIndex, pageSize);
        return seckillPageInfo;
    }

    @GetMapping("/get-map")
    @ResponseBody
    public Map sss(){
        Map map=new HashMap<>();
        map.put("ss","11");
        return map;
    }

}
